import {fileURLToPath, URL} from 'node:url'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueDevTools from 'vite-plugin-vue-devtools'

export default defineConfig({
    base: './',
    plugins: [
        vue(),
        vueJsx(),
        vueDevTools()
    ],
    build: {
        outDir: './cordova/www',
        emptyOutDir: true,
        target: 'es2015',
        rollupOptions: {
            external: ['core-js/stable', 'regenerator-runtime/runtime']
        }
    },
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    }
})
